package com.lenovo.test

import java.util.{Calendar, Date, TimeZone}

import org.apache.spark.sql.SparkSession

object test {
  def main(args: Array[String]): Unit = {

    val date = new Date(1391174450000L) // 2014-1-31 21:20:50
    println(date)
    val  calendar = Calendar.getInstance(TimeZone.getTimeZone("GMT+8"))
    calendar.setTime(date)
    println(calendar)

    val  calendar2 = Calendar.getInstance(TimeZone.getTimeZone("GMT+5"))
    println(calendar2.getTime)
    }

}
